import request from '@/utils/request'
function getUrl(url) { return '/api/' + url }


export function getInMaintenanceRecordPage(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/getInMaintenanceRecordPage"),
        method: 'post',
        data
    })
}

//维保信息
export function addMaintenanceRecord(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/addMaintenanceRecord"),
        method: 'post',
        data
    })
}

export function updateInMaintenanceRecord(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/updateInMaintenanceRecord"),
        method: 'post',
        data
    })
}

export function removeMaintenanceRecord(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/removeMaintenanceRecord"),
        method: 'post',
        data
    })
}

export function getInMaintenanceRecordVo(data){
    return request({
        url: getUrl("admin/maintenanceRecord/getInMaintenanceRecordVo"),
        method: 'post',
        data
    })
}

export function transferToMaintenanceEnterprises(data){
    return request({
        url: getUrl("admin/maintenanceRecord/transferToMaintenanceEnterprises"),
        method: 'post',
        data
    })
}

//生成故障工单
export function generateFaultWorkOrder(data){
    return request({
        url: getUrl("admin/maintenanceRecord/generateFaultWorkOrder"),
        method: 'post',
        data
    })
}

export function getMaintenanceRecordList(data){
    return request({
        url: getUrl("admin/maintenanceRecord/getInMaintenanceRecordList"),
        method: 'post',
        data
    })
}
export function autoMaintenanceRecord(data){
    return request({
        url: getUrl("admin/maintenanceRecord/autoMaintenanceRecord"),
        method: 'post',
        data
    })
}

//维保记录
export function getInRecordsVo(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/getInRecordsVo"),
        method: 'post',
        data
    })
}

export function addRecords(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/addRecords"),
        method: 'post',
        data
    })
}

export function getInRecordsList(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/getInRecordsList"),
        method: 'post',
        data
    })
}

export function removeRecords(data){
    return request({
        url: getUrl("admin/maintenanceRecord/removeRecords"),
        method: 'post',
        data
    })
}

export function updateRecords(data){
    return request({
        url: getUrl("admin/maintenanceRecord/updateRecords"),
        method: 'post',
        data
    })
}

//维保信息页面
//维保任务
export function addMaintenanceInfo(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/addMaintenanceInfo"),
        method: 'post',
        data
    })
}

export function updateInMaintenanceInfo(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/updateInMaintenanceInfo"),
        method: 'post',
        data
    })
}

export function updateMaintenanceTaskAndFeedback(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/updateMaintenanceTaskAndFeedback"),
        method: 'post',
        data
    })
}

export function removeMaintenanceInfo(data) {
    return request({
        url: getUrl("admin/maintenanceRecord/removeMaintenanceInfo"),
        method: 'post',
        data
    })
}

export function getInMaintenanceInfoVo(data){
    return request({
        url: getUrl("admin/maintenanceRecord/getInMaintenanceInfoVo"),
        method: 'post',
        data
    })
}

export function updateEnd(data){
    return request({
        url: getUrl("admin/maintenanceRecord/updateEnd"),
        method: 'post',
        data
    })
}

export function getInMaintenanceInfoList(data){
    return request({
        url: getUrl("admin/maintenanceRecord/getInMaintenanceInfoList"),
        method: 'post',
        data
    })
}

export function batchSign(data){
    return request({
        url: getUrl("admin/maintenanceRecord/batchSign"),
        method: 'post',
        data
    })
}

//根据设备id 生成故障工单
export function addFaultWorkOrder(data){
    return request({
        url: getUrl("admin/maintenanceRecord/addFaultWorkOrder"),
        method: 'post',
        data
    })
}

//根据设备id 生成维保工单
export function addMaintenanceWorkOrder(data){
    return request({
        url: getUrl("admin/maintenanceRecord/addMaintenanceWorkOrder"),
        method: 'post',
        data
    })
}

//生成维保任务
export function handleMaintenanceTask(data){
    return request({
        url: getUrl("admin/maintenanceRecord/handleMaintenanceTask"),
        method: 'get',
        data
    })
}